package com.geek.javase.ch15.work.banksync;

import java.util.concurrent.locks.ReentrantLock;

/*
 *@author wangpeng
 *2025/10/31 20:19
 *@description TODO
 */
/**
 * 取款线程类，用于执行取款操作
 * 实现Runnable接口，可作为线程任务执行
 */
public class WithdrawThread implements Runnable {
    // 创建ReentrantLock锁对象
    //private final ReentrantLock lock=new ReentrantLock();

    private Account account;

    public WithdrawThread(Account account) {
        this.account = account;
    }

    @Override
    public void run() {
        // 执行取款操作，取出
        account.withdraw(5000);
    }
}

